///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// You can generate uuid and convert it to string or from string by this class 
///</describe>
/// <date>2021/1/31</date>
///***********************************************************************
#ifndef UUID_H
#define UUID_H

#include <iostream>
#include <string>
#include "boost/uuid/uuid.hpp"

namespace SystemTool
{
	class Uuid
	{
	public:
		typedef boost::uuids::uuid UniqueId;

	public:
		// Generate uuid by random
		static UniqueId GenerateByRandom();

		// Generate uuid by string
		static bool GenerateByString(std::string strUuid, UniqueId& UuId);

		// Convert uuid to string
		static std::string ToString(UniqueId Id);

	private:
		// Check the string's format
		static bool IsFormatOk(std::string& strUuid);
	};
}

#endif // UUID_H
